/*
    1. Write a program in C to input a string and print it. 

    Test Data :
    Input the string : Welcome, w3resource

    Expected Output :

    The string you entered is : Welcome, w3resource 
*/

#include <stdio.h>
#include <stdlib.h>

char* getStr(char *str)
{
    char ch;
    char *p = str;
    while((ch = getchar()) != '\n'){
        *p = ch;
        p++;
    }
    *p = '\0';
    return str;
}

int main(void)
{
    char *str = malloc(1000);
    printf("Input the string : ");
    printf("The string you entered is : %s\n", getStr(str));
    return 0;
}